package com.station.administrators.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.open.capacity.common.model.UserModel;
import com.station.administrators.dao.UserDao;
import com.station.administrators.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author YangGang
 * @Title:
 * @Description: TODO
 * @date 2021/6/28/15:13
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public PageInfo<UserModel> findAll(UserModel userModel) {
        Integer page = userModel.getPage();
        Integer limit = userModel.getLimit();
        PageHelper.startPage(page,limit);
        PageInfo<UserModel> userModelPageInfo = new PageInfo<>(userDao.findAll(userModel));
        return userModelPageInfo;
    }

    @Override
    public void updateEnable(UserModel userModel) {
        userDao.updateEnable(userModel);
    }
}
